package com.jzy.common.exception;

import lombok.Getter;

/**
 * @author jzy
 * @date 2020/9/6 10:14
 * 10:通用
 *      001:参数校验异常
 *      002:验证码发送频繁
 * 11:商品
 * 12:订单
 * 13:购物车
 * 14:物流
 * 15:用户
 * 21:库存
 *
 */
public enum BizCodeEnum {
    UNKNOWN_EXCEPTION(10000,"系统未知异常"),
    VALID_EXCEPTION(10001,"参数校验异常"),
    PRODUCT_UP_EXCEPTION(11000,"商品上架异常"),
    SMS_CODE_SEND_EXCEPTION(10002,"验证码发送频繁"),
    TOO_MANY_REQUEST(10003,"流量过大,请稍候访问"),
    USERNAME_EXIST_EXCEPTION(15001, "用户名已存在"),
    PHONE_EXIST_EXCEPTION(15001, "手机号已存在"),
    LOGIN_EXCEPTION(15002, "账号或密码错误"),
    WEIBO_LOGIN_EXCEPTION(15002, "微博登录失败"),
    NO_STOCK_EXCEPTION(21000, "商品库存不足");

    @Getter private int code;
    @Getter private String message;

    BizCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
}
